The NDS Osax is a small set of the many NetWare 4.1 NetWare Directory Services (NDS) API calls, encapsulated into an AppleScript extension (osax). This osax is only really useful if you are using Novell's NetWare Client for Macintosh version 5.1 to connect to NetWare 4.1 file servers. (They may also work with the older MacNDS client, but no guarantees).
Uses:
Use these in a personal login script to log you in to NDS & mount some volumes (by telling the finder to open some NDS object files), or use it in a departmental shutdown script that looks at your context or user ID and takes an action depending on who you are.
Tips:
Make a call to NDS_Login with a bogus userID and password (like "xyzzy" & "blah"). If you get a return error of -30545 then you can tell if a network is connected or not if you run a script on a laptop that isn't always on the wire. Ex:
on EthernetExists()
set theanswer to false
set theError to 0
--Log in to NDS Tree
try
NDSLogin Username "xyzzy" Password "blah"
set theError to result
on error errMsg number errNum
set theError to errNum
end try
--Error -30545 is ERR_NO_SERVERS_FOUND. Hopefully this will catch being offline...
if (theError is not -30545) then
set theanswer to true
end if
return theanswer
end EthernetExists
Another tip is to use the included "Logout from NDS" script as a workaround for PCI powermac's that hang on shutdown when logged into NDS. Read the script for more info.
The NDS Osax Dictionary:
NDS_ReturnUsername:
Returns a string containing the username of the currently logged in NDS user
NDS_ReturnUsername
Result: string
NDS_ReturnContext:
Returns a string containing the context of the currently logged in NDS user
NDS_ReturnContext
Result: string
NDS_SyncWithServerTime:
Sets the internal date & time to match NDS
NDS_SyncWithServerTime
NDS_Logout:
Logs out of the NDS tree (NOTE: may or may not work if there are NetWare volumes in use still on the desktop)
NDS_Logout
NDS_Login:
Logs into the default NDS Tree & the default context (specified in the NetWare Client control panel) using the supplied username & password
NDS_Login
Username string
Password string
Result: small integer
Version History:
1.0d1 - first public release
1.0d2 - no changes to the OSAX itself, but I fixed the sample script, added a second sample script to show how to workaround PCI powermac's NDS problems.
Licensing:
NDS Osax is free to use for personal use. NDS Osax may be freely distributed with this README file and all other files included in the distribution.
For commercial use, or any use site-wide or department-wide, contact me at erich@kagi.com for an inexpensive license.